import Vue from 'vue';
import main from './main.vue';
let ToastConstructor = Vue.extend(main);
let instance;
var Toast = function(options) {
  let opt = '';
  if (typeof options === 'string') {
    opt = {
      message: options,
    };
  } else {
    opt = options;
  }
  //自定义传入的参数
  // 创建实例并且过滤参数
  instance = new ToastConstructor({ data: opt });
  // 挂载实例
  instance.$mount();
  document.body.appendChild(instance.$el);
  return instance;
};
export default Toast;
